﻿@model IPagedList<FilmListViewModel>

<div id="filmList"> @*we geven dit deze id zodat Ajax.Beginform de inhoud kan wijzigen*@

    <div class="pagedList" data-filmdb-target="#filmList">
        @Html.PagedListPager(Model, page => Url.Action("Index", new { page }),
        PagedListRenderOptions.MinimalWithItemCountText) @*previous, next, total number of items*@
    </div>


@foreach (var item in Model)
{
    <div class="film">
        <h4>@Html.ActionLink(@item.Name+" ("+@item.Year+")", "Index", "Reviews", new { id=item.Id }, null)</h4>
        <div>@item.Director</div>
        <div>Reviews: @item.CountOfReviews</div>
        <div>@Resources.AvgRating: @item.AverageOfReviews / 10</div>
        <hr />
    </div>
}
</div>